const path = require('path');
const HtmlWebpackPlugin=require('html-webpack-plugin')
module.exports = {
  entry: './src/index.js',
  devtool: false, //'source-map',
  mode: 'production',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, './build'),
    clean: true
  },
  module: {
    rules: [
      {
        test: /\.(m|e)?jsx?$/,
        use: [
          {
            loader: 'babel-loader',
          }
        ]
      },
      {
        test:/\.ts$/i,
        //use:'ts-loader'
        use:['babel-loader']
      }
    ]
  },
  plugins:[
    new HtmlWebpackPlugin({
      template:"./index.html"
    })
  ]
};
